Skip to content

Instantly share code, notes, and snippets.

@efstathiosntonas
efstathiosntonas / AudioManager.ts
Created May 17, 2024 07:40
Audio Player Chat Message with react-native-awesome-slider & react-native-audio-player-recorder
import AudioRecorderPlayer, { PlayBackType } from "react-native-audio-recorder-player";
import { isIOS } from "utils/utils";
type Callback = (args: { data?: PlayBackType; status: AudioStatus }) => void;
type Path = string | undefined;
export enum AudioStatus {
PAUSED = "PAUSED",
PLAYING = "PLAYING",
RESUMED = "RESUMED",
@Ravarcheon
Ravarcheon / spectralRotation.py
Created May 18, 2024 13:23
rotates an audio file by 90 degrees in the spectrum while being a reversible process with minimal loss (only floating point errors which are like -150 dB but thats literally silence ahaha~)
import numpy as np
import soundfile as sf
from scipy.fftpack import fft, ifft
def rotateSignal(signal,flip):
if flip:
signal = signal[::-1]
x = np.concatenate((signal, signal[1:][::-1])) # concatenating the array with a reverse of itself makes it such that the fourier transform doesn't layer over a reversed version of itself in the inverse fft
rotSig = np.real(ifft(x))
@aradalvand
aradalvand / DockerfileForSvelteKit.md
Last active May 18, 2024 18:32
Dockerfile and .dockerignore for SvelteKit:

*This Dockerfile is intended for SvelteKit applications that use adapter-node. So, the Dockerfile below assumes that you have already installed and configured the adapter.

Dockerfile:

FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json .
RUN npm ci
COPY . .
RUN npm run build
@Justasic
Justasic / inizh.patch
Last active May 18, 2024 18:30
This patches Command & Conquer: Generals Zero Hour's inizh.big file to create a GLA super worker which can build all the command centers of all factions (basically a huge cheat)
diff -r -u /tmp/Data/INI/CommandButton.ini /DataStorage/Games/Data/INI/CommandButton.ini
--- /tmp/Data/INI/CommandButton.ini 2019-07-05 21:57:33.363905699 -0700
+++ /DataStorage/Games/Data/INI/CommandButton.ini 2019-07-05 21:54:43.440602319 -0700
@@ -2632,6 +2632,15 @@
DescriptLabel = CONTROLBAR:ToolTipGLABuildWorker
End
+CommandButton Command_ConstructGLASpecialWorker
+ Command = UNIT_BUILD
+ Object = GLASpecialInfantryWorker
@ih2502mk
ih2502mk / list.md
Last active May 18, 2024 18:29
Quantopian Lectures Saved
@keijiro
keijiro / gpd_win.md
Last active May 18, 2024 18:29
My notes on using GPD Win

image

GPD Win is a really enjoyable piece of hardware.

Windows 10 Clean Installation

@davidfowl
davidfowl / MinimalAPIs.md
Last active May 18, 2024 18:28
Minimal APIs at a glance
@kayabaNerve
kayabaNerve / deanon_dero.md
Created May 17, 2024 14:53
Deanonymization of the Dero Network

The Dero Protocol

The protocol uses a pair of rings, one for the senders, one for the receivers, represented as a singular ring. With each transfer, a list of ElGamal ciphertexts is provided for all accounts within the joint ring. This ElGamal ciphertext is formed as r * G, (r * K) + (a * G), where r is some randomness, K is the key for the account the ciphertext is for, and a is the amount.

The Dero Wallet Protocol

Dero offers an 'encrypted message' with every transaction. Even if the user does not explicitly provide one, a message will exist (either with internally provided values or left empty). For the only defined type of message, the message is encoded as the index of the sender, a CBOR-encoded object, and zero-padding. The message is encrypted with the Chacha20 stream created by a key of H(H(r * K) || K) where r is some randomness and K is the key for the account the ciphertext is for.

The Issue

@jamesmacwhite
jamesmacwhite / README.md
Last active May 18, 2024 18:26
Andrews and Arnold (AAISP) L2TP on OpenWrt

Andrews and Arnold (AAISP) L2TP tunnel setup on OpenWrt

This is a guide for setting up the L2TP service from AAISP on an OpenWrt router. AAISP have an official OpenWrt guide for this but it is outdated and looks to have been originally written for OpenWrt 15.01/15.05 (Chaos Calmer), which is a long unsupported firmware build.

I have previously contacted AAISP about their documentation being out of date, however it has not been changed. It is technically not wrong, but under newer versions of OpenWrt you can simplify some of the configuration compared to the official documentation and there are also a few potential issues you might come across in OpenWrt land which are worth mentioning and saving someone else from bashing their head against a wall for hours, until you realise that the Linux kernel just hates you.

This has been tested on the latest stable OpenWrt 19.07 release branch.

Required packages